/**
 * @projectName study-note
 * @package Chain
 * @className Chain.Manager
 */
package Chain;

/**
 * Manager
 * @description 经理类
 * @author answer_wx
 * @date 2022/7/6 11:23
 * @version 1.0
 */
public class Manager extends AbstractManager {

    public Manager(String name) {
        super(name);
    }

    @Override
    public void requestAction(Request request) {
        if ("请假".equals(request.getType()) && request.getNum() <= 2) {
            System.out.println(String.format("%s：%s 天数%d被批准",name,request.getContent(),request.getNum()));
        } else {
            if (superior != null) {
                superior.requestAction(request);
            }
        }
    }
}